me3explorerfandomcom-20200213-history
PCC File Format
BioWare stores a majority of game resources inside their own proprietary version of Unreal Engine package files, called files. This article covers the uncompressed and compressed structure of PCCs, along with the correlation between file nomenclature and what game resources they store. Compressed Structure If the file is compressed, the tables and data are segmented into chunks, each of which contains a variable number of compressed blocks. Schematic representation of the compressed PCC file structure Chunks are preceded by a common header, which contains information about the chunks. The chunks header is 16 bytes in size. Each chunk has a header containing information about the raw compressed data contained in block form. The chunk header is also 16 bytes in size. The number of blocks a chunk has can be calculated by dividing the chunk uncompressed size through the block size. Each block also has a header. The block header is 8 bytes in size. Uncompressed Structure All PCC files are divided into five parts: header, name table, import table, export table and data objects. Schematic representation of the uncompressed PCC file structure The contains basic information about the structure of the PCC. Below is an example extracted from : The contains any name found inside the package (import classes, exports, and export properties, for example. Each name follows this structure: The contains all classes and objects imported by the PCC. Each entry is 28 bytes in size: The Export Table contains all objects stored in the package. Each export can vary in size. Edited PCC Structure Since ME3Explorer 3.0, the default behavior is to save pccs in the standard format, with header, name table, import table, export table, and then export data. Offsets will be different if anything has been added to the tables, or if any exports have larger datasizes. However, some files will be saved in an alternative format. Certain ME3 DLC pcc files have an export called the SeekFreeShaderCache. The structure of this export is not well understood, but the important takeaway is that it must remain at the same offset within the file for the game to read it properly. So to preserve the position, an alternate save method is used. The entire unchanged file is written, then export data that has been changed but has not grown in size is overwritten in its original location, all the tables are appended to the end, and then export data that has grown in size is appended. Table offsets are updated in the header, and a special flag is written to the Package Flags: 0x00100000 This is a flag unused by the unreal engine that we are using to indicate that this file been saved in this new format. So the next time ME3Explorer has to save this kind of file, it knows that the offset of the name table is the end of the original file, and can append data there. In this way we can preserve the original location of unchanged export data without having to append new copies of the tables everytime, which would lead to continual filesize growth every time a file was saved. Nomenclature + Contents All PCCs follow various naming conventions that specify the game content they store. The tables below summarize these conventions. BioA, BioD, and BioP files are organized by plot mission and/or location. PCC File Format PCC File Format